package testplan.entities;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class Project {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long key;
	@Persistent
	private String name;
	// foreign key to Agency
	@Persistent
	private Long agency;
	@Persistent
	private String description;

	public Project(String name, long agency, String description) {
		super();
		this.name = name;
		this.agency = agency;
		this.description = description;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getAgency() {
		return agency;
	}

	public void setAgency(Long agency) {
		this.agency = agency;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Long getKey() {
		return key;
	}
	
	public void setKey(long key)
	{
		this.key = key;
	}
	
	@Override
	public String toString()
	{
		return String.format("Project[%d] %s", key, name);
	}

}
